package com.seecoder.BlueWhale.vo;


import com.seecoder.BlueWhale.po.Store;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.util.Date;
import java.util.List;

@Getter
@Setter
@NoArgsConstructor
public class StoreVO {
    private Integer ownerID;

    private Integer id;

    private String name;

    private String logoURL;

    private Date createTime;

    private float rating;
    private String address;

    private Integer commentNumber;

    //该商店下所有商品的id列表，用主键来搜索商品拥有更高的效率
    private List<Integer> commoditiesID;

    public Store toPO() {
        Store store = new Store();
        store.setName(this.name);
        store.setId(this.id);
        store.setCreateTime(this.createTime);
        store.setCommoditiesID(this.commoditiesID);
        store.setOwnerID(this.ownerID);
        store.setLogoURL(this.logoURL);
        store.setRating(this.getRating());
        store.setAddress(this.getAddress());
        return store;
    }
}